<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS3动画</title>
</head>
<body>

<style>
    /*定义关键帧*/
    @keyframes divwidth {
        0%{ left: 0px}
        20%{left: 260px}
        40%{left: 620px}
        60%{left: 480px}
        80%{left: 280px}
        100%{left:0px}
    }
    div{
        width: 180px;
        height: 180px;
        background: red;
        position: relative;
        animation: divwidth 2s linear 0s infinite;
    }


</style>
<div>

</div>
</body>
</html>